package com.doraro.coal.moudle.purch.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.doraro.coal.moudle.purch.entity.PurchExec;
import com.doraro.coal.moudle.purch.entity.vo.PurchExecList;
import com.doraro.coal.moudle.purch.mapper.PurchExecMapper;
import com.doraro.coal.moudle.purch.service.IPurchExecService;
import com.doraro.coal.utils.ShiroUtils;
import com.doraro.coal.vo.PageParam;
import com.doraro.coal.vo.UserDto;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author doraro
 * @since 2019-10-10
 */
@Service
public class PurchExecServiceImpl extends ServiceImpl<PurchExecMapper, PurchExec> implements IPurchExecService {

    @Override
    public IPage<PurchExecList> listPage(Page<PurchExec> purchExecPage, PageParam<PurchExec> searchMap) {
        Integer status = (Integer) searchMap.get("status");
        String billNumber = (String) searchMap.get("billNumber");
        final UserDto userEntity = ShiroUtils.getUserEntity();
        return baseMapper.listPage(purchExecPage, status, billNumber,userEntity.getOrganize().getName());

    }
}
